<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://www.ecside.org" prefix="ec"%>
<jsp:useBean id="pageBean" scope="request" class="com.agileai.hotweb.domain.PageBean"/>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>流程仿真</title>
<%@include file="/jsp/inc/resource.inc.jsp"%>
<script language="javascript">
function controlBtn(stateResult){
	if(stateResult =='init'){
		enableButton("editImgBtn");
	}else{
		disableButton("editImgBtn");
	}
}
var insertBox;
function insertRequest(){
	if (!insertBox){
		insertBox = new PopupBox('insertBox','新增仿真任务',{size:'big',height:'500px',top:'10px'});		
	}
	var url = 'index?WfEmulationManageEdit';
	insertBox.sendRequest(url);
}
var updateBox;
function updateRequest(){
	if (!updateBox){
		updateBox = new PopupBox('updateBox','编辑仿真任务',{size:'big',height:'500px',top:'10px'});		
	}
	var url = 'index?WfEmulationManageEdit&WFE_ID='+$("#bizRecordId").val();
	updateBox.sendRequest(url);
}
var selectProcBox;
function selectProcRequest(){
	if (!selectProcBox){
		selectProcBox = new PopupBox('selectProcBox','选择流程',{size:'big',height:'456px',top:'10px'});		
	}
	var url = 'index?WfProcessDefineSelect&targetId=CUR_WFP_ID&targetName=CUR_WFP_NAME';
	selectProcBox.sendRequest(url);
}
function resetWfpRequest(){
	$("#CUR_WFP_ID").val("");
	$("#CUR_WFP_NAME").val("");
	doSubmit({actionType:'prepareDisplay'});	
}
</script>
</head>
<body>
<form action="<%=pageBean.getHandlerURL()%>" name="form1" id="form1" method="post">
<%@include file="/jsp/inc/message.inc.jsp"%>
<div id="__ParamBar__" style="float: right;">
流程名称
<input name="CUR_WFP_NAME" type="text" class="text" id="CUR_WFP_NAME" ondblclick="selectProcRequest()" onchange="doQuery();" value="<%=pageBean.inputValue("CUR_WFP_NAME")%>" size="16" maxlength="16" readonly="readonly" />
<input name="CUR_WFP_ID" type="hidden" id="CUR_WFP_ID" value="<%=pageBean.inputValue("CUR_WFP_ID")%>" /><img src="images/query.gif" width="16" height="16" onclick="selectProcRequest()" style="cursor:pointer" />
&nbsp;&nbsp;<input type="button" name="button" id="button" value="重置" class="formbutton" onclick="resetWfpRequest()" />
</div>
<div id="__ToolBar__">
<table border="0" cellpadding="0" cellspacing="1">
<tr height="24px;">
   <td onmouseover="onMover(this);" onmouseout="onMout(this);" hotKey="A" class="bartdx" align="center" onClick="insertRequest()"><input id="createImgBtn" title="新增" type="button" class="createImgBtn" value="&nbsp;" />新增</td>
   <td onmouseover="onMover(this);" onmouseout="onMout(this);" hotKey="E" class="bartdx" align="center" onClick="updateRequest()"><input id="editImgBtn" title="编辑" type="button" class="editImgBtn" value="&nbsp;" />编辑</td>
   <td onmouseover="onMover(this);" onmouseout="onMout(this);" hotKey="V" class="bartdx" align="center" onClick="doRequest('viewDetail')"><input id="detailImgBtn" title="查看" type="button" class="detailImgBtn" value="&nbsp;" />查看</td>   
   <td onmouseover="onMover(this);" onmouseout="onMout(this);" hotKey="D" class="bartdx" align="center" onClick="doDelete($('#'+rsIdTagId).val());"><input id="delImgBtn" title="删除" type="button" class="delImgBtn" value="&nbsp;" />删除</td>
   <td onmouseover="onMover(this);" onmouseout="onMout(this);" hotKey="B" class="bartdx" align="center" onClick="goToMain();"><input title="返回" type="button" value="&nbsp;" class="backImgBtn" />返回</td>   
</tr>
</table>
</div>
<ec:table 
form="form1"
var="row"
items="pageBean.rsList" csvFileName="流程仿真.csv"
retrieveRowsCallback="process" xlsFileName="流程仿真.xls"
useAjax="true" sortable="true"
doPreload="false" toolbarContent="navigation|pagejump |pagesize |export|extend|status"
width="100%" rowsDisplayed="10"
listWidth="100%" 
height="400px" 
>
<ec:row styleClass="odd" ondblclick="doRequest('viewDetail')" oncontextmenu="selectRow(this,{bizRecordId:'${row.WFE_ID}',WFP_ID:'${row.WFP_ID}'});refreshConextmenu();controlBtn('${row.WFE_STATUS}');" onclick="selectRow(this,{bizRecordId:'${row.WFE_ID}',WFP_ID:'${row.WFP_ID}'});controlBtn('${row.WFE_STATUS}');">
	<ec:column width="50" style="text-align:center" property="_0" title="序号" value="${GLOBALROWCOUNT}" />
	<ec:column width="240" property="WFE_TITLE" title="标题"   />
	<ec:column width="120" property="WFE_CREATERNAME" title="发起人"   />
	<ec:column width="120" property="WFE_CREATETIME" title="发起时间" cell="date" format="yyyy-MM-dd HH:mm" />
	<ec:column width="120" property="WFE_STATUS" title="状态位"/>    
</ec:row>
</ec:table>
<input type="hidden" name="bizRecordId" id="bizRecordId" value="" />
<input type="hidden" name="WFP_ID" id="WFP_ID" value="" />
<input type="hidden" name="actionType" id="actionType" />
<script language="JavaScript">
setRsIdTag('bizRecordId');
var ectableMenu = new EctableMenu('contextMenu','ec_table');
</script>
</form>
</body>
</html>
<%@include file="/jsp/inc/scripts.inc.jsp"%>
